(function() {
	var midEvent = require("./index");
	var notify = require("../server/RESTAPI/notify");
	midEvent.on("bus.space.use_state.changed", function(bus_id, space_id) {
		var role = midEvent.Tool.role;
		var space = midEvent.Class.BusSpace.get(space_id);
		//发送给商家，后台管理用
		var bus_sockSet = role.getBusSockSet(bus_id);
		notify.send(bus_sockSet, "bus.space.use_state.changed", space);
		//发送给用户，前台选择用
		var user_sockSet = role.getAllUserSockSet();
		console.log(user_sockSet);
		notify.send(user_sockSet, "bus.space.use_state.changed", space);
	});
}());